void keyPressed() {
  KeyAct=true;
  inputMsg="Key "+key+" = "+int(key);
  println(inputMsg);
  int action=-1;
  int keyIn=int(key);
  float keyFlo=0.0;
  if (key=='t') {
    testInput();
  }
  if (setWindowAddress) {
    if ((keyIn>47)&&(keyIn<53)) {
      setWindowAddress=false; //clear the state if the proper keys weren't entered
      setWindowSize=true;
    } else { 
      if (!(keyIn>96)&&(keyIn<113)) {
        setWindowAddress=false;
      }
    }
    // set window size and positon
    if ((setWindowSize)&&(!androidMode)) {
      if ((keyIn>47)&&(keyIn<53)) {  // '0' thru '4'
        int code = keyIn-48;
        int bloomI = 0;
        if (code>0) { 
          bloomI = int(bloom[0]);
        }
        positionWindow(code, bloomI);
      }
      setWindowSize=false;
    }
  }
  switch (keyIn) {
  case 10: // 'enter'
    action=3;
    break;
    /*  force setup of OSC GUI */
  case 8: // 'backspace'
    action=0;
    break;
    /* monitor mode */
  case 45: // '-'
    monitorMode=!monitorMode;
    setWindowAddress=false;
    break; 
    /* another setup routine...duplicitous?  */
  case 92: // '|'
    envSetup();
    break;
    /*  transition type */
  case 91: // '['
    action=4;
    keyIn=1;
    break;
  case 93: // ']'
    action=4;
    keyIn=2;
    break;
    /*  show bloom address */
  case 47: // '/'
    showBloomAddress=!showBloomAddress;
    if (!showBloomAddress) {  
      background(0);    /*! erase the bloom text */
    }
    break; 
    /*  tone test for Chymera */
  case 61: // '='
    if (!androidMode) {
      println("maketone " +makeTone);
      makeToneTrigger=!makeToneTrigger;
    }
    break;
  case 96: // '`'
    setWindowAddress=true;
    break;
  default:
    break;
  }

  //! toggle bloom state; action 1
  if ((keyIn>96)&&(keyIn<113)) {
    keyIn-=97;
    if (setWindowAddress) {
      char reBloom = char(keyIn+65);
      bloom[0]=str(keyIn);
      bloom[1]=str(reBloom);
      makeToneTrigger=true;
      println("bloom0 now= "+bloom[1]);
      if (monitorMode) {
        positionWindow(5, int(bloom[0]));
      }
      setWindowAddress=false;
    } else {
      action=1; /* 1 = flower toggle */
    }
  }
  //! set the active facet; action 2
  if ((keyIn>64)&&(keyIn<81)) {
    action=2; // 2 = facet switch
    keyIn-=65;
  }

  /* ok...let's get out of here  */

  if (action>-1) {
    echoAction(action, keyIn, keyFlo);
  }

  /* now clean up; get ready for next message */


  DisplayAct=true;
  KeyAct=false;
}//** end keyPressed() **
